home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
273_01
/
index.cc
< prev
next >
Wrap
Text File
|
1988-02-09
|
447b
|
13 lines
#include <stdlib.h>
char *index(char *str, char c)
/*------------------------------------------------------------------------------
INDEX - returns a pointer to the first occurance of 'c' in the string pointed
to by 'str', or NULL if 'str' does not contain 'c'.
------------------------------------------------------------------------------*/
{
while( (*str != c) && *(str++) );
if( *str == c )
return( str );
return( NULL );
}